package com.zhudi.controller;

import com.zhudi.model.request.PostNameRequest;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class UserController {


    @GetMapping("/SayHello")
    public String sayHello(String name){
        return "hello "+name;
    }

    @PostMapping("/postName")
    public String postName(@RequestBody PostNameRequest postNameRequest){
        if (postNameRequest==null){
            return "name is null";
        }
        return "你的名字是"+postNameRequest.getName();
    }

}
